/**
 * Copyright (c) 2008 Trent Hoeppner
 * 
 * This file is part of BillCalc.
 * 
 * BillCalc is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * BillCalc is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with BillCalc.  If not, see <http://www.gnu.org/licenses/>.
 **/

package com.trentech.billcalc.event;

import java.util.Date;

import com.trentech.billcalc.FinanceManager;
import com.trentech.billcalc.Resident;

/**
 * ArriveEvent is an Event for when a resident moves into the apartment.
 */
public class ArriveEvent extends Event {
    
    /**
     * Constructor for ArriveEvent.
     * 
     * @param   date    the date that the resident arrived.  Cannot be null.
     * @param   name    the name of the resident.  Cannot be null or empty.
     */
    public ArriveEvent(Date date, String name) {
        super(date, name);
    }


    /**
     * Creates a new {@link Resident} with the given name and arrival date.
     * 
     * @param   manager the FinancialManager to help process this Event.  
     *                  Cannot be null.
     */
    public void process(FinanceManager manager) {
        Resident resident = new Resident(getName(), getDate());
        manager.addResident(resident);
    }
}
